<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>Document</title>
  </head>

  <body>
    <script>
      // 数值交换方法一
      // var num1 = 10,
      //     num2 = 20,
      //     temp;
      // temp = num1;
      // num1 = num2;
      // num2 = temp;

      // 数值交换方法一
      // console.log(num1);
      // console.log(num2);

      // var num1 = 30,
      //     num2 = 20;
      // num1 = num2 + num1;
      // num2 = num1 - num2;
      // num1 = num1 - num2;
      // console.log(num1);
      // console.log(num2);

      //  数据的转换
      var str = "123";
      var str1 = "sjdfd";
      var str2 = "123kdgj";
      var str3 = "12.36kdgj";
      var num1 = 12;
      var num2 = 123;
      var kong = null;
      var str4 = 10;
      console.log(+str4);
      console.log(parseInt(str));
      console.log(parseInt(str1));
      console.log(parseInt(str2));
      console.log(parseFloat(str2));
      console.log(parseFloat(str3));
      console.log(parseFloat(str1));
      console.log(Number(str1));
      console.log(Number(str));
      console.log(Number(str2));
      console.log(String(num1));
      console.log(num1.toString());
      console.log(Boolean(1));
      console.log(Boolean(-11));
      console.log(Boolean(null));
      console.log(Boolean(""));
      console.log(Boolean(undefined));
      console.log(parseInt("10"));
    </script>
  </body>
</html>
